<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8" language="java" %>
<html>
<head>
    <title>EL的11大隐式对象</title>
</head>
<body>
${b=23} <br>
<%--pageContext可以获取以下对象 ：request，session，application等--%>
\${pageContext}=${pageContext} <br>
${pageContext.request}=${pageContext.request} <br>
${pageContext.session}=${pageContext.session} <br>
${pageContext.servletContext}=${pageContext.servletContext} <br>
${pageContext.request}=${pageContext.request.contextPath}   reques t.getContextPath jvavaBean的属性规则  br
<hr>
<%--下面这些对象都 是map--%>
${pageScope} \${pageScope.a} ====${a} <br>
${requestScope} \${requestScope.a} ====${a} <br>
${sessionScope} \${sessionScope.a} ====${a} <br>
${applicationScope} \${applicationScope.a} ====${a} <br>
<hr>
<%--param对象--%>
\${param}=${param} <br>
\${param.userName}=${param.userName} <br>
\${param.userPwd}=${param.userPwd} <br>
<hr>
<%--paramValues对象--%>
\${paramValues}=${paramValues} <br>
\${paramValues.userName[0]}=${paramValues.userName[0]} <br>
\${paramValues.userPwd[0]}=${paramValues.userPwd[0]} <br>
\${paramValues.hobby[0]}=${paramValues.hobby[0]} <br>
\${paramValues.hobby[1]}=${paramValues.hobby[1]} <br>
\${paramValues.hobby[2]}=${paramValues.hobby[2]} <br>
<hr>
<%--initParam对象--%>
\${initParam}=${initParam} <br>
\${initParam.name}=${initParam.name} <br>
\${initParam.encoding}=${initParam.encoding} <br>
<hr>
<%--cookie对象--%>
<%
    //向浏览器写一个cookie
    Cookie cookie1 = new Cookie("userName","tom");
    response.addCookie(cookie1); //向浏览器发送一个cookie 它是存放在浏览器的缓存中 set-Cookie:userName=tom
    Cookie cookie2 = new Cookie("userPwd","123");
    response.addCookie(cookie2);    //向浏览器发送一个cookie 它是存放在浏览器的缓存中  set-Cookie:userPwd=123
%>
\${cookie}=${cookie} <br>
\${cookie.userName.name}=${cookie.userName.value} <br>
\${cookie.userPwd.value}=${cookie.userPwd.value} <br>
\${cookie["userPwd"]["value"]}=${cookie["userPwd"]["value"]} <br>


</html>>
